package com.yiqi.lottery.feature.mine.model;

import com.suozhang.framework.component.http.RxDataProcessFactory;
import com.yiqi.lottery.entity.bo.BalanceBo;
import com.yiqi.lottery.entity.bo.RegisterBo;
import com.yiqi.lottery.feature.mine.contract.BanlanceContract;
import com.yiqi.lottery.feature.mine.contract.BindContract;
import com.yiqi.lottery.feature.mine.dependencies.banlance.DaggerBanlanceModelComponent;
import com.yiqi.lottery.feature.mine.dependencies.bind.DaggerBindModelComponent;
import com.yiqi.lottery.framework.api.ApiLib;
import com.yiqi.lottery.framework.api.UserApi;
import io.reactivex.Observable;

import javax.inject.Inject;

public class BanlanceModel implements BanlanceContract.Model {

    @Inject
    UserApi api;


    @Inject
    public BanlanceModel() {

        DaggerBanlanceModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<BalanceBo> getMyBanlance() {
        return api.getMyBalance().compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
